<script lang="ts" setup>
import { computed } from 'vue'
import { useAppStore } from '@/store/modules/app'

const appStore = useAppStore()
const toggleClick = () => {
  appStore.triggerSidebarOpened()
}

const icon = computed(() => {
  return appStore.getSidebarOpened ? 'hamburger-opened' : 'hamburger-closed'
})
</script>

<template>
  <div id="hamburger-container" class="hamburger-container flex justify-center items-center cursor-pointer" @click="toggleClick">
    <svg-icon class="hamburger" :icon="icon" />
  </div>
</template>

<style lang="scss" scoped>
.hamburger-container {
  padding: 0 16px 0 20px;
  margin-right: 5px;

  .hamburger {
    display: inline-block;
    width: 20px;
    height: 20px;
    color: $primaryColor;
    vertical-align: middle;
  }
}
</style>
